//
//  DDuploadNetWorkEngine.h
//  hnGovernment
//
//  Created by zhn on 2017/3/14.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DDnetWrokEngine.h"
typedef void(^DDuploadProgressBlock)(NSProgress *progress);
typedef void(^DDuploadSuccessBlcok)(id result);
@interface DDuploadNetWorkEngine : NSObject

/**
 请求的基础路径
 */
@property (nonatomic,copy) NSString *baseURL;

/**
 请求的url
 */
@property (nonatomic,copy) NSString *requestURL;

/**
 上传的图片
 */
@property (nonatomic,strong) UIImage *uploadImage;

/**
 上传图片的压缩比例 （0 - 1,默认不压缩）
 */
@property (nonatomic,assign) CGFloat compressPercent;

/**
 成功的回调
 */
@property (nonatomic,copy) DDuploadSuccessBlcok success;

/**
 失败的回调
 */
@property (nonatomic,copy) failureBlock failure;

/**
 上传的百分比的回调
 */
@property (nonatomic,copy) DDuploadProgressBlock uploadprogress;

/**
 请求的参数
 */
@property (nonatomic,copy) NSDictionary *params;

/**
 初始化方法

 @param image 要上传的图片
 @param baseUrl 基础路径
 @param requestUrl 请求路径
 @param progress 上传的百分比的回调
 @param success 上传成功的回调
 @param failure 上传失败的回调
 @return engine
 */
+ (instancetype)uploadengineWithImage:(UIImage *)image
                              baseUrl:(NSString *)baseUrl
                           requestUrl:(NSString *)requestUrl
                             progress:(DDuploadProgressBlock)progress
                              success:(DDuploadSuccessBlcok)success
                              failure:(failureBlock)failure;
@end
